package com.yanq.liancar.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.gson.Gson;
import com.gyf.barlibrary.ImmersionBar;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import com.vondear.rxtool.RxActivityTool;
import com.yanq.liancar.R;
import com.yanq.liancar.activity.CarSellingActivity;
import com.yanq.liancar.activity.DesignatedDrivingActivity;
import com.yanq.liancar.activity.IntegralDetailsActivity;
import com.yanq.liancar.activity.LoginActivity;
import com.yanq.liancar.activity.SmallCAutoinsurance;
import com.yanq.liancar.activity.SmallCBuyVIPActivity;
import com.yanq.liancar.activity.SmallCDelicateCarWashActivity;
import com.yanq.liancar.activity.SmallCFuelFillingActivity;
import com.yanq.liancar.activity.SmallCFullServiceActivity;
import com.yanq.liancar.activity.SmallCLuckDrawActivity;
import com.yanq.liancar.activity.SmallCNewsActivity;
import com.yanq.liancar.activity.SmallCPersonalInformation;
import com.yanq.liancar.activity.SmallCRescueActivity;
import com.yanq.liancar.activity.SmallCSearchActivity;
import com.yanq.liancar.adapter.HomeAdapter;
import com.yanq.liancar.address_selection.CityPickerActivity;
import com.yanq.liancar.base.BaseLazyFragment;
import com.yanq.liancar.bean.HomeBean;
import com.yanq.liancar.bean.HomePageMessage;
import com.yanq.liancar.bean.MyBanner;
import com.yanq.liancar.bean.UserBean;
import com.yanq.liancar.bean.WeatherBean;
import com.yanq.liancar.url.Config;
import com.yanq.liancar.util.GlideImageLoader;
import com.yanq.liancar.util.LogUtils;
import com.yanq.liancar.view.VerticalSwipeRefreshLayout;
import com.youth.banner.Banner;
import com.youth.banner.BannerConfig;
import com.youth.banner.listener.OnBannerListener;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import de.hdodenhof.circleimageview.CircleImageView;

import static android.app.Activity.RESULT_OK;

/**
 * A simple {@link Fragment} subclass.
 */
public class HomeFragment extends BaseLazyFragment {
    @BindView(R.id.ll_top)
    LinearLayout toolbar;
    @BindView(R.id.tv_search)
    TextView mTvSearchl;
    private CircleImageView mCircleImageView;
    private Banner mBanner;
    private TextView tv_weidenglu, tv_cheshou, tv_OpponentNum;
    @BindView(R.id.recycler_c)
    RecyclerView mRecyclerView;
    @BindView(R.id.img_news)
    ImageView img_news;
    @BindView(R.id.tv_city11111)
    TextView tvCity;
    @BindView(R.id.img_weather)
    ImageView imgWeather;
    @BindView(R.id.tv_weather)
    TextView tvWeather;
    private TextView tv_runtextview;
    private RatingBar ratingbar;
    private ImageView img_youjia;
    private LinearLayout ll_top, ll_bottom;
    private View headView;
    //private List<String> mItemList = new ArrayList<>();
    private List<MyBanner> mBanners;
    private HomeAdapter mHomeAdapter;
    private TextView header_home_chepai;
    private ImageView vipImg;
    private RelativeLayout Advertisement_chexian;
    private LinearLayout Advertisement_maiche;
    protected ImageView img_radio;

    //声明AMapLocationClient类对象
    private AMapLocationClient mLocationClient = null;
    //声明AMapLocationClientOption对象
    private AMapLocationClientOption mLocationOption = null;
    private String city, province, code;
    private List<HomeBean> mHomeBeanList=new ArrayList<>();


    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        getLocation();
        LogUtils.e("111111111111", "HomeFragment======onViewCreated");
    }

    @Override
    protected int setLayoutId() {
        return R.layout.fragment_home;
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(mActivity).statusBarColor(R.color.white).statusBarDarkFont(true).init();
    }

    @Override
    public void onResume() {
        super.onResume();
        //获取用户头像和车牌号码
        getInitUserInfo();
        LogUtils.e("111111111111", "HomeFragment======onResume");
    }

    @Override
    protected void initView() {
        super.initView();
        final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(),
                LinearLayoutManager.VERTICAL, false);
        mRecyclerView.setLayoutManager(layoutManager);
        mHomeAdapter = new HomeAdapter(R.layout.item_one,mHomeBeanList);
        mRecyclerView.setAdapter(mHomeAdapter);
        mHomeAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                Bundle bundle=new Bundle();
                String url = null;
                if (position==0){
                    url="http://llc.value19.com/index.php?s=/goods/goodsinfo&goodsid=3";
                }else if (position==1){
                    url="http://llc.value19.com/index.php?s=/goods/goodsinfo&goodsid=4";
                }else if (position==2){
                    url="http://llc.value19.com/index.php?s=/goods/goodsinfo&goodsid=5";
                }else if (position==3){
                    url="http://llc.value19.com/index.php?s=/goods/goodsinfo&goodsid=9";
                }else if (position==4){
                    url="http://llc.value19.com/index.php?s=/goods/goodsinfo&goodsid=6";
                }
                bundle.putString("url",url);
                RxActivityTool.skipActivity(mActivity, IntegralDetailsActivity.class,bundle);
            }
        });

        addHeadView();
        // 当列表滑动到倒数第N个Item的时候(默认是1)回调onLoadMoreRequested方法
        mHomeAdapter.setPreLoadNumber(1);
        mHomeAdapter.setNewData(mHomeBeanList);

        tvCity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mActivity, CityPickerActivity.class);
                startActivityForResult(intent, 001);
            }
        });

    }


    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == RESULT_OK) {
            if (requestCode == 001) {
                tvCity.setText(data.getStringExtra("picked_city"));
                //天气接口
                initUserInfo();
            }
        }
    }

    private void addHeadView() {
        headView = LayoutInflater.from(getActivity()).inflate(R.layout.header_home, (ViewGroup) mRecyclerView.getParent(), false);
        mBanner = headView.findViewById(R.id.banner);
        mCircleImageView = headView.findViewById(R.id.circleImageView);
        header_home_chepai = headView.findViewById(R.id.header_home_chepai);
        vipImg = headView.findViewById(R.id.img_vip);
        tv_weidenglu = headView.findViewById(R.id.tv_weidenglu);
        ratingbar = headView.findViewById(R.id.home_ratingbar);
        img_youjia = headView.findViewById(R.id.img_youjia);
        ll_top = headView.findViewById(R.id.ll_top);
        ll_bottom = headView.findViewById(R.id.ll_bottom);
        Advertisement_chexian = headView.findViewById(R.id.Advertisement_chexian);
        Advertisement_maiche = headView.findViewById(R.id.Advertisement_maiche);
        tv_runtextview = headView.findViewById(R.id.tv_runtextview);
        img_radio = headView.findViewById(R.id.img_radio);

        mHomeAdapter.addHeaderView(headView);
        initData();
        initBannerData(mBanners);
        setListener();

        tv_weidenglu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RxActivityTool.skipActivity(mActivity, LoginActivity.class);
            }
        });
        //抽奖
        Glide.with(mActivity).load(R.drawable.youjia).into(img_youjia);
        img_youjia.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (TextUtils.isEmpty(UserBean.getcToken(mActivity))) {
                    RxActivityTool.skipActivity(mActivity, LoginActivity.class);
                } else {
                    Bundle bundle = new Bundle();
                    bundle.putInt("where", 1);
                    RxActivityTool.skipActivity(mActivity, SmallCLuckDrawActivity.class, bundle);
                }
            }
        });
        //钣金喷漆
        headView.findViewById(R.id.tv_rescue).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle5 = new Bundle();
                bundle5.putInt("type", 5);
                RxActivityTool.skipActivity(mActivity, SmallCDelicateCarWashActivity.class, bundle5);
            }
        });
        //优惠加油
        headView.findViewById(R.id.tv_fuel_filling).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RxActivityTool.skipActivity(mActivity, SmallCFuelFillingActivity.class);
            }
        });
        //高价卖车
        headView.findViewById(R.id.tv_query).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //RxActivityTool.skipActivity(mActivity,SmallCQueryActivity.class);
                RxActivityTool.skipActivity(mActivity, CarSellingActivity.class);
            }
        });
        //购买VIP
        headView.findViewById(R.id.tv_buyVIP).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RxActivityTool.skipActivity(mActivity, SmallCBuyVIPActivity.class);
            }
        });
        //极速救援
        headView.findViewById(R.id.tv_autoinsurance).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RxActivityTool.skipActivity(mActivity, SmallCRescueActivity.class);
            }
        });
        //特惠洗车（修改为跳转到标准洗车）
        headView.findViewById(R.id.tv_CarWash).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //                RxActivityTool.skipActivity(mActivity, DelicateCarWashContentActivity.class);
                Bundle bundle1 = new Bundle();
                bundle1.putInt("type", 2);
                RxActivityTool.skipActivity(mActivity, SmallCDelicateCarWashActivity.class, bundle1);
            }
        });
        //全部
        headView.findViewById(R.id.tv_whole).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RxActivityTool.skipActivity(mActivity, SmallCFullServiceActivity.class);
            }
        });
        //抽奖
        headView.findViewById(R.id.tv_luckdraw).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putInt("where", 2);
                RxActivityTool.skipActivity(mActivity, SmallCLuckDrawActivity.class, bundle);
            }
        });
        //保养维修
        headView.findViewById(R.id.tv_baoyang).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle3 = new Bundle();
                bundle3.putInt("type", 4);
                RxActivityTool.skipActivity(mActivity, SmallCDelicateCarWashActivity.class, bundle3);
            }
        });

        //头像->个人中心
        mCircleImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!TextUtils.isEmpty(UserBean.getcToken(mActivity))) {
                    Bundle bundle = new Bundle();
                    bundle.putString("where", "MineFragment");
                    RxActivityTool.skipActivity(mActivity, SmallCPersonalInformation.class, bundle);
                } else {
                    RxActivityTool.skipActivity(mActivity, LoginActivity.class);
                }
            }
        });

        //特价车险
        headView.findViewById(R.id.tv_autoinsurance1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RxActivityTool.skipActivity(mActivity, SmallCAutoinsurance.class);
            }
        });

        //广告特价车险
        Advertisement_chexian.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RxActivityTool.skipActivity(mActivity, SmallCAutoinsurance.class);
            }
        });

        //广告特价卖车
        Advertisement_maiche.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RxActivityTool.skipActivity(mActivity, CarSellingActivity.class);
            }
        });

        //代驾服务
        headView.findViewById(R.id.tv_driving).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RxActivityTool.skipActivity(mActivity, DesignatedDrivingActivity.class);
            }
        });

    }


    //天气
    private void initUserInfo() {
        OkGo.<String>post("https://free-api.heweather.com/s6/weather/now?location=" + tvCity.getText().toString())
                .tag(this)
                .params("unit", "i")
                .params("key", "b2a241e35aab4d15987ebae5e7feeb67")
                .execute(new StringCallback() {
                    @Override
                    public void onSuccess(Response<String> response) {
                        LogUtils.e("qeqweqe", response.body());
                        Gson gson = new Gson();
                        WeatherBean info = gson.fromJson(response.body(), WeatherBean.class);
                        if (info.getHeWeather6() != null) {
                            WeatherBean.HeWeather6Bean heWeather6Bean = info.getHeWeather6().get(0);
                            if ("ok".equals(heWeather6Bean.getStatus())) {
                                int weather = (int) ((heWeather6Bean.getNow().getTmp() - 32) / 1.8);
                                tvWeather.setText(weather + "℃");
                                String str = heWeather6Bean.getNow().getCond_txt();
                                if (str.contains("晴")) {
                                    imgWeather.setImageResource(R.mipmap.qing);
                                } else if (str.contains("云")) {
                                    imgWeather.setImageResource(R.mipmap.duoyun);
                                } else if (str.contains("雨")) {
                                    imgWeather.setImageResource(R.mipmap.yu);
                                } else if (str.contains("雪")) {
                                    imgWeather.setImageResource(R.mipmap.xue);
                                } else if (str.contains("风")) {
                                    imgWeather.setImageResource(R.mipmap.feng);
                                } else if (str.contains("霾")) {
                                    imgWeather.setImageResource(R.mipmap.mai);
                                } else {
                                    imgWeather.setImageResource(R.mipmap.weizhi);
                                }
                            } else {
                                imgWeather.setImageResource(R.mipmap.weizhi);
                                tvWeather.setText("未知");
                            }
                        }
                    }
                });
    }

    //    ====================================================================================================

    protected void setListener() {
//        mRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
//            @Override
//            public void onRefresh() {
//                new Handler().postDelayed(new Runnable() {
//                    @Override
//                    public void run() {
//                        mItemList.clear();
//                        mItemList.addAll(newData());
//                        mHomeAdapter.setNewData(mItemList);
//                        mRefreshLayout.setRefreshing(false);
//                    }
//                }, 2000);
//            }
//        });
//
//        mHomeAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
//            @Override
//            public void onLoadMoreRequested() {
//                new Handler().postDelayed(new Runnable() {
//                    @Override
//                    public void run() {
//                        mHomeAdapter.addData(addData());
//                        if (mItemList.size() == 5) {
//                            mHomeAdapter.loadMoreEnd();
//                        } else
//                            mHomeAdapter.loadMoreComplete();
//                    }
//                }, 2000);
//            }
//        }, mRecyclerView);

        mTvSearchl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putInt("type", 0);
                RxActivityTool.skipActivity(mActivity, SmallCSearchActivity.class, bundle);
            }
        });

        img_news.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putString("where", "HomeFragment");
                RxActivityTool.skipActivity(mActivity, SmallCNewsActivity.class, bundle);
            }
        });
    }


    protected void initData() {
//        for (int i = 1; i <= 20; i++) {
//            mItemList.add("库存" + i);
//        }
        mBanners = new ArrayList<>();
        MyBanner ban0 = new MyBanner(0, R.mipmap.car_bg);
        MyBanner ban1 = new MyBanner(1, R.mipmap.car_bg);
        MyBanner ban2 = new MyBanner(2, R.mipmap.car_bg);

        mBanners.add(ban0);
        mBanners.add(ban1);
        mBanners.add(ban2);


        mHomeBeanList=new ArrayList<>();
        HomeBean bean1=new HomeBean();
        bean1.setImage(R.mipmap.laola);
        bean1.setName("劳拉NEW慕尚24寸");
        bean1.setIntegral("73740");
        bean1.setPrice(BigDecimal.valueOf(2458));
        mHomeBeanList.add(bean1);

        HomeBean bean2=new HomeBean();
        bean2.setImage(R.mipmap.xiaobangwang);
        bean2.setName("【小霸王】多功能维修工具");
        bean2.setIntegral("4140");
        bean2.setPrice(BigDecimal.valueOf(138));
        mHomeBeanList.add(bean2);

        HomeBean bean3=new HomeBean();
        bean3.setImage(R.mipmap.duomianshou);
        bean3.setName("【多面手】多功能螺丝批");
        bean3.setIntegral("6840");
        bean3.setPrice(BigDecimal.valueOf(228));
        mHomeBeanList.add(bean3);

        HomeBean bean4=new HomeBean();
        bean4.setImage(R.mipmap.yingji);
        bean4.setName("【应急】多功能汽车安全锤");
        bean4.setIntegral("14340");
        bean4.setPrice(BigDecimal.valueOf(478));
        mHomeBeanList.add(bean4);

        HomeBean bean5=new HomeBean();
        bean5.setImage(R.mipmap.jishi);
        bean5.setName("【技师】多功能车用安全锤");
        bean5.setIntegral("8940");
        bean5.setPrice(BigDecimal.valueOf(298));
        mHomeBeanList.add(bean5);
//        mHomeAdapter.notifyDataSetChanged();
    }


    private void initBannerData(final List<MyBanner> mBanners) {
        List<Integer> imageUrl = new ArrayList<>();
        for (MyBanner myBanner : mBanners) {
            imageUrl.add(myBanner.resId);
        }
        mBanner.setImageLoader(new GlideImageLoader())
                .setImages(imageUrl)//设置图片集合
                .setDelayTime(4000)//设置轮播时间
                .setBannerStyle(BannerConfig.CIRCLE_INDICATOR)//设置指示器位置（当banner模式中有指示器时）
                .setIndicatorGravity(BannerConfig.CENTER)
                .start();//banner设置方法全部调用完毕时最后调用

        mBanner.setOnBannerListener(new OnBannerListener() {
            @Override
            public void OnBannerClick(int position) {
                // ToastUtils.showToast(getContext(), "您点击了第" + (mBanners.get(position).type + 1) + "张照片");
            }
        });
    }


//    private List<String> addData() {
//        List<String> data = new ArrayList<>();
//        for (int i = mItemList.size() + 1; i <= mItemList.size() + 20; i++) {
//            data.add("库存" + i);
//        }
//        return data;
//    }
//
//    private List<String> newData() {
//        List<String> data = new ArrayList<>();
//        for (int i = 1; i <= 20; i++) {
//            data.add("库存" + i);
//        }
//        return data;
//    }

    private void getLocation() {
        mLocationClient = new AMapLocationClient(getActivity());
        mLocationOption = new AMapLocationClientOption();
        //        /**
        //         * 设置定位场景，目前支持三种场景（签到、出行、运动，默认无场景）
        //         */
        //        mLocationOption.setLocationPurpose(AMapLocationClientOption.AMapLocationPurpose.SignIn);
        //        if(null != mLocationClient){
        //            mLocationClient.setLocationOption(mLocationOption);
        //            //设置场景模式后最好调用一次stop，再调用start以保证场景模式生效
        //            mLocationClient.stopLocation();
        //            mLocationClient.startLocation();
        //        }

        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
        //获取一次定位结果
        mLocationOption.setOnceLocation(true);
        //设置是否返回地址信息（默认返回地址信息）
        mLocationOption.setNeedAddress(true);
        //关闭缓存机制
        mLocationOption.setLocationCacheEnable(true);
        //给定位客户端对象设置定位参数
        mLocationClient.setLocationOption(mLocationOption);
        //启动定位
        mLocationClient.startLocation();
        mLocationClient.setLocationListener(new AMapLocationListener() {
            @Override
            public void onLocationChanged(AMapLocation aMapLocation) {
                if (aMapLocation != null) {
                    if (aMapLocation.getErrorCode() == 0) {
                        city = aMapLocation.getCity();
                        tvCity.setText(city);
                        province = aMapLocation.getProvince();
                        code = aMapLocation.getCityCode();
                        LogUtils.e("地址信息：", city + "======" + province);
                        //天气接口
                        initUserInfo();
                    } else {
                        //定位失败时，可通过ErrCode（错误码）信息来确定失败的原因，errInfo是错误信息，详见错误码表。
                        Log.e("地址信息", "location Error, ErrCode:"
                                + aMapLocation.getErrorCode() + ", errInfo:"
                                + aMapLocation.getErrorInfo());
                    }
                }
            }
        });

    }

    //轮播图、头像、车牌号
    private void getInitUserInfo() {
        OkGo.<String>get(Config.s + "llc/chomePageController/querycLoginHomePageMessage")
                .tag(this)
                .params("token", UserBean.getcToken(mActivity))
                .execute(new StringCallback() {
                    @Override
                    public void onSuccess(Response<String> response) {
                        LogUtils.e("qeqweqe", response.body());
                        Gson gson = new Gson();
                        HomePageMessage info = gson.fromJson(response.body(), HomePageMessage.class);
                        if (info.isIsSuccess()) {
                            if (info.getData() != null) {
                                tv_weidenglu.setVisibility(View.GONE);
                                ll_bottom.setVisibility(View.VISIBLE);
                                ll_top.setVisibility(View.VISIBLE);

                                if (info.getData().getScore() != 0 && info.getData().getStar() != 0) {
                                    //tv_OpponentNum.setText(info.getData().getScore() + "");
                                    tv_runtextview.setText("恭喜您击败全国" + info.getData().getScore() + "的车手 " + "获得" + info.getData().getStar() + "星车手称号");
                                } else {
                                    ratingbar.setVisibility(View.GONE);
                                    img_radio.setVisibility(View.GONE);
                                }

                                if (info.getData().getHeadPage() != null) {
                                    RequestOptions options = new RequestOptions();
                                    options.error(R.mipmap.ic_fxp);
                                    Glide.with(mActivity).load(info.getData().getHeadPage()).apply(options).into(mCircleImageView);
                                }
                                if (info.getData().getCarNum() != null) {
                                    header_home_chepai.setText(info.getData().getCarNum());
                                }
                                if (info.getData().getIsVip() != 0) {
                                    vipImg.setVisibility(View.VISIBLE);
                                    if (info.getData().getIsVip() == 1) {
                                        vipImg.setImageResource(R.mipmap.v1);
                                    } else {
                                        vipImg.setImageResource(R.mipmap.v2);
                                    }
                                } else {
                                    vipImg.setVisibility(View.GONE);
                                }
                            }
                        } else {
                            mCircleImageView.setImageResource(R.mipmap.ic_fxp);
                            vipImg.setVisibility(View.GONE);
                            tv_weidenglu.setVisibility(View.VISIBLE);
                            ll_top.setVisibility(View.GONE);
                            ll_bottom.setVisibility(View.GONE);
                        }
                    }
                });
    }


}
